package com.jlpay.openapi.demo.ledger.balancesplit;

import com.jlpay.open.jlpay.sdk.java.model.ledger.request.BalanceRefundQueryRequest;
import com.jlpay.open.jlpay.sdk.java.model.ledger.response.BalanceRefundQueryResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author dengwenning
 * @since 2024/8/30
 **/
public class BalanceRefundQueryService {

    private static final Logger LOGGER = LoggerFactory.getLogger(BalanceRefundQueryService.class);

    public static void main(String[] args) {
        BalanceRefundQueryRequest balanceRefundQueryRequest = buildBalanceRefundQueryRequest();
        BalanceRefundQueryResponse balanceRefundQueryResponse = JlpayOpenApiService.openMerchService()
                .post(balanceRefundQueryRequest, BalanceRefundQueryResponse.class);
        LOGGER.info("余额分账回退结果查询响应:{}", JsonUtils.toString(balanceRefundQueryResponse));
    }

    private static BalanceRefundQueryRequest buildBalanceRefundQueryRequest() {
        BalanceRefundQueryRequest balanceRefundQueryRequest = new BalanceRefundQueryRequest();
        balanceRefundQueryRequest.setOrgCode("50720711");
        balanceRefundQueryRequest.setOutReturnNo("12e3045e13146bf9d590d12c65c11");
        return balanceRefundQueryRequest;
    }
}
